import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
export type Maybe<T> = T | null;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
const defaultOptions =  {}
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
  ID: string;
  String: string;
  Boolean: boolean;
  Int: number;
  Float: number;
};

export type Answer = {
  __typename?: 'Answer';
  _id: Scalars['Int'];
  userId: Scalars['String'];
  content: Scalars['String'];
};

export type Category = {
  __typename?: 'Category';
  _id: Scalars['Int'];
  name: Scalars['String'];
  problems: Array<Problem>;
};

export type Mutation = {
  __typename?: 'Mutation';
  login: Scalars['String'];
  register: User;
  createQuestion: Question;
  removeQuestion: Scalars['Boolean'];
  createProblem: Problem;
  removeProblem: Scalars['Boolean'];
  createCategory: Category;
  removeCategory: Scalars['Boolean'];
  createAnswer: Answer;
  removeAnswer: Scalars['Boolean'];
};


export type MutationLoginArgs = {
  password: Scalars['String'];
  userName: Scalars['String'];
};


export type MutationRegisterArgs = {
  password: Scalars['String'];
  userName: Scalars['String'];
};


export type MutationCreateQuestionArgs = {
  verifyCode: Scalars['String'];
  content: Scalars['String'];
  categoryId: Scalars['Int'];
  title: Scalars['String'];
};


export type MutationRemoveQuestionArgs = {
  _id: Scalars['Float'];
};


export type MutationCreateProblemArgs = {
  verifyCode: Scalars['String'];
  content: Scalars['String'];
  categoryId: Scalars['Int'];
  name: Scalars['String'];
};


export type MutationRemoveProblemArgs = {
  _id: Scalars['Float'];
};


export type MutationCreateCategoryArgs = {
  name: Scalars['String'];
};


export type MutationRemoveCategoryArgs = {
  _id: Scalars['Float'];
};


export type MutationCreateAnswerArgs = {
  verifyCode: Scalars['String'];
  content: Scalars['String'];
  categoryId: Scalars['Int'];
  name: Scalars['String'];
};


export type MutationRemoveAnswerArgs = {
  _id: Scalars['Float'];
};

export type Problem = {
  __typename?: 'Problem';
  _id: Scalars['Int'];
  name: Scalars['String'];
  categoryId: Scalars['Float'];
  content: Scalars['String'];
  verifyCode: Scalars['String'];
};

export type Query = {
  __typename?: 'Query';
  user: User;
  categories: Array<Category>;
};


export type QueryUserArgs = {
  _id: Scalars['String'];
};

export type Question = {
  __typename?: 'Question';
  _id: Scalars['Int'];
  title: Scalars['String'];
  userId: Scalars['String'];
  content: Scalars['String'];
};

export type User = {
  __typename?: 'User';
  _id: Scalars['String'];
  userName: Scalars['String'];
  name: Scalars['String'];
  EXP: Scalars['Int'];
};

export type GetCategoriesQueryVariables = Exact<{ [key: string]: never; }>;


export type GetCategoriesQuery = { __typename?: 'Query', categories: Array<{ __typename?: 'Category', _id: number, name: string, problems: Array<{ __typename?: 'Problem', _id: number, name: string, categoryId: number, content: string, verifyCode: string }> }> };

export type LoginMutationVariables = Exact<{
  userName: Scalars['String'];
  password: Scalars['String'];
}>;


export type LoginMutation = { __typename?: 'Mutation', login: string };

export type RegisterMutationVariables = Exact<{
  userName: Scalars['String'];
  password: Scalars['String'];
}>;


export type RegisterMutation = { __typename?: 'Mutation', register: { __typename?: 'User', _id: string } };


export const GetCategoriesDocument = gql`
    query GetCategories {
  categories {
    _id
    name
    problems {
      _id
      name
      categoryId
      content
      verifyCode
    }
  }
}
    `;

/**
 * __useGetCategoriesQuery__
 *
 * To run a query within a React component, call `useGetCategoriesQuery` and pass it any options that fit your needs.
 * When your component renders, `useGetCategoriesQuery` returns an object from Apollo Client that contains loading, error, and data properties
 * you can use to render your UI.
 *
 * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
 *
 * @example
 * const { data, loading, error } = useGetCategoriesQuery({
 *   variables: {
 *   },
 * });
 */
export function useGetCategoriesQuery(baseOptions?: Apollo.QueryHookOptions<GetCategoriesQuery, GetCategoriesQueryVariables>) {
        const options = {...defaultOptions, ...baseOptions}
        return Apollo.useQuery<GetCategoriesQuery, GetCategoriesQueryVariables>(GetCategoriesDocument, options);
      }
export function useGetCategoriesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<GetCategoriesQuery, GetCategoriesQueryVariables>) {
          const options = {...defaultOptions, ...baseOptions}
          return Apollo.useLazyQuery<GetCategoriesQuery, GetCategoriesQueryVariables>(GetCategoriesDocument, options);
        }
export type GetCategoriesQueryHookResult = ReturnType<typeof useGetCategoriesQuery>;
export type GetCategoriesLazyQueryHookResult = ReturnType<typeof useGetCategoriesLazyQuery>;
export type GetCategoriesQueryResult = Apollo.QueryResult<GetCategoriesQuery, GetCategoriesQueryVariables>;
export const LoginDocument = gql`
    mutation login($userName: String!, $password: String!) {
  login(userName: $userName, password: $password)
}
    `;
export type LoginMutationFn = Apollo.MutationFunction<LoginMutation, LoginMutationVariables>;

/**
 * __useLoginMutation__
 *
 * To run a mutation, you first call `useLoginMutation` within a React component and pass it any options that fit your needs.
 * When your component renders, `useLoginMutation` returns a tuple that includes:
 * - A mutate function that you can call at any time to execute the mutation
 * - An object with fields that represent the current status of the mutation's execution
 *
 * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
 *
 * @example
 * const [loginMutation, { data, loading, error }] = useLoginMutation({
 *   variables: {
 *      userName: // value for 'userName'
 *      password: // value for 'password'
 *   },
 * });
 */
export function useLoginMutation(baseOptions?: Apollo.MutationHookOptions<LoginMutation, LoginMutationVariables>) {
        const options = {...defaultOptions, ...baseOptions}
        return Apollo.useMutation<LoginMutation, LoginMutationVariables>(LoginDocument, options);
      }
export type LoginMutationHookResult = ReturnType<typeof useLoginMutation>;
export type LoginMutationResult = Apollo.MutationResult<LoginMutation>;
export type LoginMutationOptions = Apollo.BaseMutationOptions<LoginMutation, LoginMutationVariables>;
export const RegisterDocument = gql`
    mutation register($userName: String!, $password: String!) {
  register(userName: $userName, password: $password) {
    _id
  }
}
    `;
export type RegisterMutationFn = Apollo.MutationFunction<RegisterMutation, RegisterMutationVariables>;

/**
 * __useRegisterMutation__
 *
 * To run a mutation, you first call `useRegisterMutation` within a React component and pass it any options that fit your needs.
 * When your component renders, `useRegisterMutation` returns a tuple that includes:
 * - A mutate function that you can call at any time to execute the mutation
 * - An object with fields that represent the current status of the mutation's execution
 *
 * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;
 *
 * @example
 * const [registerMutation, { data, loading, error }] = useRegisterMutation({
 *   variables: {
 *      userName: // value for 'userName'
 *      password: // value for 'password'
 *   },
 * });
 */
export function useRegisterMutation(baseOptions?: Apollo.MutationHookOptions<RegisterMutation, RegisterMutationVariables>) {
        const options = {...defaultOptions, ...baseOptions}
        return Apollo.useMutation<RegisterMutation, RegisterMutationVariables>(RegisterDocument, options);
      }
export type RegisterMutationHookResult = ReturnType<typeof useRegisterMutation>;
export type RegisterMutationResult = Apollo.MutationResult<RegisterMutation>;
export type RegisterMutationOptions = Apollo.BaseMutationOptions<RegisterMutation, RegisterMutationVariables>;